missing project/build files
[client-tools.git] / src / engine / client / application / TerrainEditor / How To.txt
blobca0ec4c932c13f28060984227a43fbe7fa19952f
1 Steps For Adding a New Property Page
3 For a layer property page:
5 1.  Create a dialog resource.
7 2.  Set the dialog style to "Child", and its border to "None".
9 3.  Use Class Wizard to create a new class derived from CFormView and associated with the dialog resource.
11 4.  As necessary, create and attach member varibles to any dialog controls.
13 5.  As necessary, create an OnInitialUpdate() function to initialize any controls.
15 6.  As necessary, override TerrainToolFormView::ApplyChanges() if your form contains any edit boxes or other
16     controls that are difficult to catch "new data" messages.  ApplyChanges () will be called before the file is saved,
17         this form is replaced by another, and before the map is redrawn.  In here you can get the latest control data.
19 7.  In the class header file, rederive the class from FormBaseLayer instead of 
20     CFormView (replace all references to "CFormView").
22 8.  In the class header file, add a member of type of "pointer of" TerrainGenerator::LayerItem or of a type 
23     derived from TerrainGenerator::LayerItem.
25 9.  In the class header file, define a member function that overrides FormBaseLayer::Initialize (ViewData* vd);
27 10.  In the class implementation file, remove the following compiler flag code (it conflicts with the engine):
28       #ifdef _DEBUG
29       #define new DEBUG_NEW
30       #undef THIS_FILE
31       static char THIS_FILE[] = __FILE__;
32       #endif
35 11.  In the class implementation file, replace all references to "CFormView" with "FormBaseLayer".
37 12.  In the class implementation file, change the BEGIN_MESSAPE_MAP macro to attach to "TerrainToolFormView" instead
38     of "CFormView" or "FormBaseLayer".  Only "TerrainToolFormView" allows the ClassWizard to support the MFC dialog/form
39         callbacks.  I don't know why.
41 13. In the class implementation file, within Initialize() attach the "viewData" input parameter to the class's 
42     TerrainGenerator::LayerItem pointer.  Use "dynamic_cast" and check for a NULL result that would indicate
43         the wrong type of data was passed in.
45 14. In the class implementation file, initialize the form's controls in OnInitialUpdate ().
47 15. In TerrainEditorDoc::getLayerRuntimeClass(), add or find the branch for this layer type, and set the return argument
48     in that branch to be this propery class.
50 16. Include header files as necessary in all files to complete compilation.  Note, you may need to add "resource.h" to the
51     form class' header file to provide the dialog resource id to the class' enum.